import React from 'react';
import {Card, Button, message} from 'antd';
import './ui.less';

export default class Message extends React.Component {

  render() {

    return (
      <div>
        <Card title="通知提醒框" className="card-wrap">
          <Button type="primary" onClick={() => this.handleMessage("success")}>Success</Button>
          <Button type="primary" onClick={() => this.handleMessage("warning")}>Warning</Button>
          <Button type="primary" onClick={() => this.handleMessage("error")}>Error</Button>
          <Button type="primary" onClick={() => this.handleMessage("loading")}>Loading</Button>
        </Card>
      </div>
    );
  }

  handleMessage = (type) => {
    message[type]("Welcome to use Global message component!");
  }
}